package com.xcity.game.activity2.circle;

import com.xcity.game.item.ItemTemplate;

import naga.x.App;
import naga.x.game.template.Template;
import naga.x.game.template.TemplateException;
import naga.x.game.template.TemplateService;
import naga.x.game.template.annotation.Excel;

/**
 * 排名奖励
 * @author shipeng.zhu
 *
 */
@Excel(value = "circle.xlsx", sheetName = "排名奖励")
public class CircleRankRewardTemplate extends Template {

	/** 排名 */
	protected int rank;
	
	/** 类型 */
	protected int type;

	/** 钱 */
	protected int money;

	/** 钻石 */
	protected int stone;

	/** 物品ID */
	protected int[] itemId;

	/** 数量 */
	protected int[] itemCount;

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public int getMoney() {
		return money;
	}

	public void setMoney(int money) {
		this.money = money;
	}

	public int getStone() {
		return stone;
	}

	public void setStone(int stone) {
		this.stone = stone;
	}

	public int[] getItemId() {
		return itemId;
	}

	public void setItemId(int[] itemId) {
		this.itemId = itemId;
	}

	public int[] getItemCount() {
		return itemCount;
	}

	public void setItemCount(int[] itemCount) {
		this.itemCount = itemCount;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Override
	public void validate() throws TemplateException {
		if(money <= 0 && stone <= 0 && itemId == null && itemCount == null){
			throw new TemplateException("circle.xlsx欢乐转盘排行奖励配置错误->id=" + id);
		}else if(itemId != null && itemCount != null){
			if(itemId.length != itemCount.length){
				throw new TemplateException("circle.xlsx欢乐转盘排行奖励配置错误->id=" + id);
			}
		}
	}
}
